package interview.common;

import java.util.ArrayList;

public class NnaryTreeNode extends TreeNode {
	int position;
	String parentEdgeLabel;
	ArrayList<NnaryTreeNode> children;
	
	public NnaryTreeNode() {
		children = new ArrayList<NnaryTreeNode>();
	}
	
	public int getPosition() {
		return position;
	}
	
	public void setPosition(int p) {
		this.position = p;
	}
	
	public ArrayList<NnaryTreeNode> getChildren() {
		return children;
	}
	
	public NnaryTreeNode getChild(int index) {
		if(index < children.size() - 1) {
			return children.get(index);
		}
		return null;
	}
	
	public void addChildren(NnaryTreeNode c) {
		children.add(c);
	}
	
	public void setParentEdgeLabel(String label) {
		this.parentEdgeLabel = label;
	}
	
	public String getParentEdgeLabel() {
		return parentEdgeLabel;
	}
	
	public void setChildren(ArrayList<NnaryTreeNode> c) {
		this.children = c;
	}
}
